#include "engine.h"
#include "timer.h"

long long freqinit()
{
	LARGE_INTEGER freq;
	::QueryPerformanceFrequency(&freq);
	return freq.QuadPart;
}

long long getacttick()
{
	LARGE_INTEGER counter;
	::QueryPerformanceCounter(&counter);
	return counter.QuadPart;

}

double systemfreq=(double)freqinit();

void timer_t::start()
{
	starttick=getacttick();
}

float timer_t::getactseconds()
{
	long long acttick=getacttick();

	return float(double(acttick-starttick)/systemfreq);

}
